package com.gxuwz.medical.vo;

import java.util.ArrayList;
import java.util.List;

import com.gxuwz.medical.domain.menu.Menu;

public class PageBean {
	private List<Object> pageData;
	private int currentpage=0;
	private int size=5;
	private int totalcount;
	
	public PageBean(){}
	public PageBean(int currentpage,int size,int totalcount){
		this.currentpage=currentpage;
		this.size = size;
		this.totalcount=totalcount;
	}
	public int getTotalPage(){//计算总页数
		if(this.totalcount%this.size==0){
			return this.totalcount/this.size;
		}
		return this.totalcount/this.size+1;
	}
	public boolean isFirst(){
		return (this.currentpage==1)||(this.totalcount==0);
	}
	public boolean isLast(){
		return (this.currentpage>=this.getTotalPage())||(this.totalcount==0);
	}
	public boolean isHasNext(){
		return !this.isLast();
	}
	public boolean isHasPrev(){
		return !this.isFirst();
	}


	public List<Object> getPageData() {
		return pageData;
	}
	public void setPageData(List<Object> pageData) {
		this.pageData = pageData;
	}
	public int getCurrentpage() {
		return currentpage;
	}
	public void setCurrentpage(int currentpage) {
		this.currentpage = currentpage;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int getTotalcount() {
		return totalcount;
	}
	public void setTotalcount(int totalcount) {
		this.totalcount = totalcount;
	}
	
}
